namespace CSharpPro._1023;
public class Student
{
    private int id;
    public string name;
 
    private static Student instance = new Student();
   
    public static Student GetInstance()
    {
        return instance;
    }
    private Student()
    {
        Console.WriteLine("无参构造方法执行");
    }

    private Student(int id, string name)
    {
        this.id = id;
        this.name = name;
        Console.WriteLine("带参构造方法执行");
    }
    
    ~Student()
    {
        Console.WriteLine("析构方法执行（对象被回收）");
    }

    public int GetId()
    {
        return this.id;
    }
}